<template>
    <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="900px" @open="open" @close="close">
        <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="页面编号" prop="code" :rules="rules.validateRequire">
                        <el-input v-model="model.code" :disabled="!(user.adminlevel===9)"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="名称" prop="name" :rules="rules.validateRequire">
                        <el-input v-model="model.name" placeholder="请输入字段名称"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="上级页面" prop="parentPageName">
                        <el-input v-model="parentPage.name" :disabled="true"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <!-- <el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段1" prop="extendfield1" >
						<el-input v-model="model.extendfield1" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段2" prop="extendfield2" >
						<el-input v-model="model.extendfield2" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段3" prop="extendfield3" >
						<el-input v-model="model.extendfield3" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段4" prop="extendfield4" >
						<el-input v-model="model.extendfield4" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段5" prop="extendfield5" >
						<el-input v-model="model.extendfield5" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段6" prop="extendfield6" >
						<el-input v-model="model.extendfield6" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段7" prop="extendfield7" >
						<el-input v-model="model.extendfield7" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段8" prop="extendfield8" >
						<el-input v-model="model.extendfield8" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段9" prop="extendfield9" >
						<el-input v-model="model.extendfield9" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="扩展字段10" prop="extendfield10" >
						<el-input v-model="model.extendfield10" type="textarea" :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row> -->
            <el-row>
                <el-col :span="24">
                    <el-form-item label="备注" prop="description">
                        <el-input v-model="model.description" type="textarea" :rows="4"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
            <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
        </div>
    </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
import { mixin_page_fields_custom } from '@/views/gpm/gpmProjectInfo/mixin/mixin_page_fields_custom.js'
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
    mixins: [mixin_edit],
    components: {},
    data() {
        return {
            moduleTitle: '前端Vue页面信息表',
            urlPrefix: '/mis/vuePageInfo/',
            url: {
                // 额外的url
            },
            parentPage: {}
        }
    },
    methods: {
        loaded() {
            // 页面加载完毕执行
            this.getFieldsPlaceHolder('test')
        },
        /** 提交前执行 */
        beforeSubmit() {
            this.model.parentid = this.parentPage.id
            return true
        },
        /** 打开VUE页面信息参照 */
        openMisVuePageInfoRefDialog() {
            this.$refs.pageRef.visible = true
        },
        /** 获取VUE页面信息参数数据 */
        getMisVuePageInfoRefData(selectionRow, selectKey, selectionValue) {
            this.$set(this.model, 'parentid', selectionRow.id)
        },
        /** 页面关闭时执行 - zhanglongfei 2019.10.18 */
        close() {
            // 上级页面信息复位
            this.parentPage = {}
        }
    },
    mounted() {

    }
}
</script>
